package cn.iocoder.yudao.module.ai.dal.mysql.picturesort;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.picturesort.PictureSortDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.picturesort.vo.*;

/**
 * 图片分类 Mapper
 *
 * @author zhangyujun
 */
@Mapper
public interface PictureSortMapper extends BaseMapperX<PictureSortDO> {

    default PageResult<PictureSortDO> selectPage(PictureSortPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PictureSortDO>()
                .likeIfPresent(PictureSortDO::getName, reqVO.getName())
                .eqIfPresent(PictureSortDO::getSort, reqVO.getSort())
                .betweenIfPresent(PictureSortDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PictureSortDO::getId));
    }

}